package com.java.multipledatasource.spring.factory;

import com.java.multipledatasource.spring.service.Test02;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.stereotype.Component;

/**
 * @author huxb
 * @date 2020/10/18 0018 下午 9:48
 * @Desciption
 *
 * 执行时机 扫描 解析 放入 BeanDefitionMap 之后实例化之前
 */
@Component
public class LuBanBeanFactoryProcess implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        GenericBeanDefinition test02 = (GenericBeanDefinition) beanFactory.getBeanDefinition("test02");
        int autowireMode = test02.getAutowireMode();
        System.err.println("autowireMode    " +  autowireMode);

    }
}
